<!--
描述：人员管理-老师维护-新增组件
开发人：sunlf
开发日期：2017年8月17日
-->
<template lang="pug">
    kalix-dialog.user-add(bizKey="teacher" ref="kalixBizDialog" v-bind:formModel.sync="formModel" isView)
        div.el-form(slot="dialogFormSlot")
            el-form-item.s-flex(label="教师类别" prop="beOnExternal" v-bind:label-width="labelWidth")
                el-switch(v-model="formModel.beOnExternal" active-text="转外聘" inactive-text="转在编" active-value="1" inactive-value="0" disabled)
            div.s-flex
                el-form-item.s-flex_item(label="所在部门" prop="orgId" v-bind:label-width="labelWidth")
                    kalix-tree2.inline(v-model="formModel.orgId" v-bind:treeDataURL="orgURL" disabled)
                el-form-item.s-flex_item(v-if="formModel.beOnExternal === '0'" label="入校年份" prop="entranceYear" v-bind:label-width="labelWidth")
                    kalix-date-picker(v-model="formModel.entranceYear" type="year" readonly)
                el-form-item.s-flex_item(v-else label="启聘年份" prop="entranceYear" v-bind:label-width="labelWidth")
                    kalix-date-picker(v-model="formModel.entranceYear" type="year" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="工号" prop="code" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.code" readonly)
                el-form-item.s-flex_item(label="姓名" prop="name" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.name" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="身份证号" prop="identificationCard" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.identificationCard" readonly)
                el-form-item.s-flex_item(label="性别" prop="sex" v-bind:label-width="labelWidth")
                    kalix-dict-select(v-model="formModel.sex" appName="admin" dictType="性别" disabled)
            div.s-flex
                el-form-item.s-flex_item(label="出生日期" prop="birthday" v-bind:label-width="labelWidth")
                    kalix-date-picker(v-model="formModel.birthday" readonly)
                el-form-item.s-flex_item(label="民族" prop="nation" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.nation" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="籍贯" prop="placeOfOrigin" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.placeOfOrigin" readonly)
                el-form-item.s-flex_item(label="现住址" prop="address" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.address" readonly)
            el-form-item(label="照片" prop="icon" v-bind:label-width="labelWidth")
                kalix-upload(v-model="formModel.icon" v-bind:isImage="true" style="width:100%" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="学历" prop="education" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.education" readonly)
                el-form-item.s-flex_item(label="学位" prop="degree" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.degree" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="职称" prop="positionalTitles" v-bind:label-width="labelWidth")
                    kalix-dict-select(v-model="formModel.positionalTitles" appName="admin" dictType="职称" disabled)
                el-form-item.s-flex_item(label="特殊身份" prop="specialIdentity" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.specialIdentity" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="岗位" prop="position" v-bind:label-width="labelWidth")
                    kalix-dict-select(v-model="formModel.position" appName="admin" dictType="岗位名称" disabled)
                el-form-item.s-flex_item(v-if="formModel.beOnExternal === '0'" label="是否在岗" prop="beOnDuty" v-bind:label-width="labelWidth")
                    kalix-dict-select(v-model="formModel.beOnDuty" appName="admin" dictType="sf" disabled)
                el-form-item.s-flex_item(v-else label="是否聘任" prop="beOnDuty" v-bind:label-width="labelWidth")
                    kalix-dict-select(v-model="formModel.beOnDuty" appName="admin" dictType="sf" disabled)
            div.s-flex
                el-form-item.s-flex_item(label="联系电话" prop="phone" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.phone" readonly)
                el-form-item.s-flex_item(label="手机" prop="mobile" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.mobile" readonly)
            el-form-item.s-flex(v-if="formModel.beOnExternal === '0'" label="电子邮件" prop="email" v-bind:label-width="labelWidth")
                el-input(v-model="formModel.email" readonly)
            div.s-flex(v-else)
                el-form-item.s-flex_item(label="电子邮件" prop="email" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.email" readonly)
                el-form-item.s-flex_item(label="所属单位" prop="originUnit" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.originUnit" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="个人简历" prop="resume" v-bind:label-width="labelWidth")
                    el-input(type="textarea" v-model="formModel.resume" readonly)
                el-form-item.s-flex_item(label="个人说明" prop="introduction" v-bind:label-width="labelWidth")
                    el-input(type="textarea" v-model="formModel.introduction" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="学术研究" prop="learning" v-bind:label-width="labelWidth")
                    el-input(type="textarea" v-model="formModel.learning" readonly)
                el-form-item.s-flex_item(label="教学情况" prop="teaching" v-bind:label-width="labelWidth")
                    el-input(type="textarea" v-model="formModel.teaching" readonly)
            div.s-flex
                el-form-item.s-flex_item(label="擅长课程" prop="coursesSkills" v-bind:label-width="labelWidth")
                    el-input(type="textarea" v-model="formModel.coursesSkills" readonly)
                el-form-item.s-flex_item(label="预备知识" prop="preliminary" v-bind:label-width="labelWidth")
                    el-input(type="textarea" v-model="formModel.preliminary" readonly)
            el-form-item.s-flex(label="备注" prop="remark" v-bind:label-width="labelWidth")
                el-input(type="textarea" v-model="formModel.remark" readonly)
</template>
<script type="text/ecmascript-6">
    import FormModel from './model'
    import {orgURL} from '../../config.toml'

    export default {
        name: 'AdminTeacherView',
        data() {
            return {
                formModel: Object.assign({}, FormModel),
                orgURL: orgURL,
                labelWidth: '120px'
            }
        },
        components: {}
    }
</script>
